<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
        <a style="float: right;margin-right: 12%;margin-top: -10px;"
           has-permission permission='plat.platInfo.add' ui-sref="main.plat.platInfo.add" class="btn btn-sm btn-info">
            <i class="icon-tag m-r-sm text-md"></i>添加资讯平台</a>
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
                <!--<div class="w-lg">-->
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="searchParams.platNo" id="platNo"
                                   placeholder="资讯平台编号">
                        </div>
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.moduleNo"
                                    ng-options="dp.moduleNo as dp.moduleName for dp in platInfoListName" id="moduleNo" ng-change="changeParent()">
                                <option value="">--平台所属分类名称--</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="searchParams.platName" id="platName"
                                   placeholder="资讯平台名称">
                        </div>

                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-primary"  type="submit">查 询</button></label>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-dark" ng-click="clearSearch()">清 空</button></label>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label" >
                                <button type="button"  class="ifc-btn btn-success editSortBtn" ng-click="editSort($event)" >拖拽排序</button>
                                <button type="button"  style="display: none" class="ifc-btn btn-success saveSortBtn" ng-click="saveSort($event)" >保存</button>
                            </label>
                        </div>

                    </div>
                </form>
                <!--</div>-->
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center sort" >
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>资讯平台编号</th>
                        <th>资讯平台名称</th>
                        <th>平台logo</th>
                        <th>平台简介</th>
                        <th>平台所属分类</th>
                        <th>平台所属分类名称</th>
                        <th id="sortId">排序号</th>
                        <th>平台订阅量</th>
                        <th>初始未读数量</th>
                        <th>新增数量</th>
                        <th>是否可用</th>
                        <th>是否默认订阅</th>
                        <th>创建时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="platInfoList">
                    <tr ng-repeat="item in pageInfo.records">
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle">{{item.platNo}}</td>
                        <td class="v-middle" style="color: green" ng-if="item.platName.length > 6" ng-mouseover="preview(item.platName)" ng-mouseout="outHide()">{{item.platName | limitTo:6}}...</td>
                        <td class="v-middle"  style="color: green" ng-if="item.platName.length <= 6">{{item.platName }}</td>
                        <td class="v-middle">
                        <span ng-if="item.platLogo!=''"><img src="{{item.platLogo}}" ng-click="preview2(item.platLogo)" style="width: 50px;height: 40px;"/></span>
                            <span ng-if="item.platLogo==''"></span>
                        </td>

                        <!--<td class="v-middle">{{item.sortNum}}</td>-->
                        <td class="v-middle" style="color: green" ng-if="item.platDesc.length > 11" ng-mouseover="preview1(item.platDesc)" ng-mouseout="outHide1()">{{item.platDesc | limitTo:11}}...</td>
                        <td class="v-middle"  style="color: green" ng-if="item.platDesc.length <= 11">{{item.platDesc }}</td>

                        <td class="v-middle">{{item.moduleNo}}</td>
                        <td class="v-middle">{{item.platInfoText}}</td>
                        <td class="v-middle">{{item.sortNum}}</td>
                        <td class="v-middle" style="display:none;"><input type="tel" style="width:40px" value = "{{item.sortNum}}"/></td>
                        <td class="v-middle" style="color: #00AF00">{{item.platCount}}</td>
                        <td class="v-middle" style="color: red">{{item.initNum}}</td>
                        <td class="v-middle" style="color: darkgreen">{{item.addNum}}</td>
                        <td class="v-middle">
                            <div style="margin-top: 10px; width: 45px; align:center; margin: 0 auto;">
                                <input ng-if="item.enable=='Y'" ng-click="oper(item.platNo,$event)" id="checked_{{item.platNo}}"  checked type="checkbox" class="switch" />
                                <input ng-if="item.enable=='N'" ng-click="oper(item.platNo,$event)" id="checked_{{item.platNo}}"  type="checkbox" class="switch" />
                                <label class="switchlabel" for="checked_{{item.platNo}}"></label>
                            </div>
                        </td>
                        <td class="v-middle">
                            <div style="margin-top: 10px; width: 45px; align:center; margin: 0 auto;">
                                <input ng-if="item.isDefault=='Y'" ng-click="isDefaultSet(item.platNo,$event)" id="checked_is{{item.platNo}}"  checked type="checkbox" class="switch" />
                                <input ng-if="item.isDefault=='N'" ng-click="isDefaultSet(item.platNo,$event)" id="checked_is{{item.platNo}}"  type="checkbox" class="switch" />
                                <label class="switchlabel" for="checked_is{{item.platNo}}"></label>
                            </div>
                        </td>
                        <td class="v-middle">{{item.createTime}}</td>
                        <td class="v-middle">{{item.updateTime}}</td>
                        <td class="v-middle">
                            <div class="row">
                              <div >
                                    <span>
                                        <a ui-sref="main.plat.platInfo.update({id: item.platNo})" class="btn btn-sm btn-default">
                                        <i class="fa fa-edit m-r-xs text-sm"></i>编辑
                                       </a>
                                    </span>
                                  <!--功能重复，暂时注掉-->
                                    <!--<span>-->
                                        <!--<a ng-click="deleteByPlatInfo(item.platNo)" class="btn btn-sm btn-default">-->
                                        <!--<i class="fa fa-ban m-r-xs text-sm"></i>删除-->
                                       <!--</a>-->
                                    <!--</span>-->
                              </div>

                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!--图片展示弹出框-->
            <div class="cover" ng-show="firstApply">
                <div class="firstApplyWrap noselect">
                    <div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply=false">&#xe608;</i></div>
                    <div class="title">
	           			<span ng-repeat="item in platLogo track by $index">
                            <a target='_blank' href='{{item}}'><img alt='' height='100' width='300' src='{{item}}'></a>
	           			</span>
                    </div>
                </div>
            </div>

            <!--用于显示平台名称的样式-->
            <div id="showDiv" style="position: fixed; background-color: black; border: 0px solid black;color: yellow"></div>

            <!--用于显示平台简介内容的样式-->
            <div id="showDiv1" style="position: fixed; background-color: black; border: 0px solid black;color: yellow"></div>

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->

<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap{
        width: 550px;
        height:280px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }
    .firstApplyWrap .title{
        font-size: 18px;
        color:#333;
        padding:18px 86px 0 130px;
        text-align: center;
        line-height: 2em;
    }
    .firstApplyWrap .closeBtn,.finishData .closeBtn{
        font-size: 30px;
        padding:5px 20px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }
    .finishData .closeBtn{
        position: absolute;
        top:10px;
        right:10px;
    }
    .firstApplyWrap .bkgIcon{
        position: absolute;
        left: 54px;
        top:87px;
        font-size: 50px;
        color:#FFB136;
    }
    .firstApplyWrap .applyBtnWrap{
        position: absolute;
        bottom: -2px;
        width: 100%;
    }
    .firstApplyWrap .applyBtn{
        width: 50%;
        height:70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color:#fff;
        cursor: pointer;
        float:left;
    }
    .firstApplyWrap .applyBtn:last-child{
        background: #5796FC;
    }


    .switch{
        display:none;
    }
    .switchlabel{
        position:relative;
        display: block;
        padding: 1px;
        border-radius: 24px;
        height: 22px;
        margin-bottom: 15px;
        background-color: #eee;
        cursor: pointer;
        vertical-align: top;
        -webkit-user-select: none;
    }
    .switchlabel:before{
        content: '';
        display: block;
        border-radius: 24px;
        height: 22px;
        background-color: #BFBFBF;
        -webkit-transform: scale(1, 1);
        -webkit-transition: all 0.3s ease;
    }
    .switchlabel:after{
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -11px;
        margin-left: -11px;
        width: 22px;
        height: 22px;
        border-radius: 22px;
        background-color: white;
        box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.08);
        -webkit-transform: translateX(-9px);
        -webkit-transition: all 0.3s ease;
    }
    .switch:checked~label:after{
        -webkit-transform: translateX(9px);
    }
    .switch:checked~label:before{
        background-color:green;
    }
</style>